import Vue from "vue";
import VueRouter from "vue-router";
//登录页面引入
import index from "@/views/index.vue";
// 后台管理系统
import adminIndex from "@/admin/index.vue";
Vue.use(VueRouter);

const routes = [
  {
    //登录页面路劲
    path: "/",
    name: "index",
    redirect: "/home", //重定向路劲
    component: index,
    children: [
      {
        path: "/home",
        name: "首页",
        component: () => import("@/views/home/home.vue"),
      },
      {
        path: "/campus_information",
        name: "校园资讯",
        component: () =>
          import("@/views/campusInformation/campusInformation.vue"),
      },
      {
        path: "/campus_information/details/:id",
        name: "校园资讯",
        component: () =>
          import("@/views/campusInformation/campusInformationDetails.vue"),
      },
      {
        path: "/resource_sharing",
        name: "资源共享",
        component: () => import("@/views/resourceSharing/resourceSharing.vue"),
      },
      {
        path: "/resource_sharing/details/:id",
        name: "资源共享",
        component: () =>
          import("@/views/resourceSharing/resourceSharingDetails.vue"),
      },
      {
        path: "/mutual_aid",
        name: "互助物品",
        component: () => import("@/views/mutualAid/mutualAid.vue"),
      },
      {
        path: "/mutual_aid/details/:id",
        name: "互助物品",
        component: () => import("@/views/mutualAid/mutualAidDetails.vue"),
      },
      {
        path: "/lost_and_found",
        name: "失物招领",
        component: () => import("@/views/lostAndFound/lostAndFound.vue"),
      },
      {
        path: "/lost_and_found/details/:id",
        name: "失物招领",
        component: () => import("@/views/lostAndFound/lostAndFoundDetails.vue"),
      },
      {
        path: "/task_publishing",
        name: "帮啦任务发布",
        component: () => import("@/views/taskPublishing/taskPublishing.vue"),
      },
      {
        path: "/task_publishing/details/:id",
        name: "帮啦任务发布",
        component: () =>
          import("@/views/taskPublishing/taskPublishingDetails.vue"),
      },
      {
        path: "/individual_center",
        name: "个人中心",
        component: () =>
          import("@/views/individualCenter/individualCenter.vue"),
      },
      {
        path: "/admin/login",
        name: "个人中心",
        component: () => import("@/views/login/adminLogin.vue"),
      },
    ],
  },
  {
    path: "/login",
    name: "登录注册",
    component: () => import("@/views/login/login.vue"),
  },

  {
    //登录页面路劲
    path: "/admin",
    name: "adminIndex",
    component: adminIndex,
    redirect: "/admin/home", //重定向路劲
    children: [
      {
        path: "/admin/home",
        name: "首页",
        component: () => import("@/admin/home/home.vue"),
      },
      {
        path: "/admin/user/list",
        name: "用户列表",
        component: () => import("@/admin/user/user.vue"),
      },
      {
        path: "/admin/campus_information/list",
        name: "校园资讯列表",
        component: () =>
          import("@/admin/campusInformation/campusInformation.vue"),
      },
      {
        path: "/admin/campus_information/add/:id",
        name: "校园资讯",
        component: () =>
          import("@/admin/campusInformation/campusInformationAdd.vue"),
      },
      {
        path: "/admin/resource_sharing/list",
        name: "资源共享列表",
        component: () => import("@/admin/resourceSharing/resourceSharing.vue"),
      },
      {
        path: "/admin/resource_sharing/add/:id",
        name: "资源共享修改新增",
        component: () =>
          import("@/admin/resourceSharing/resourceSharingAdd.vue"),
      },
      {
        path: "/admin/mutual_aid/list",
        name: "互助物品列表",
        component: () => import("@/admin/mutualAid/mutualAid.vue"),
      },
      {
        path: "/admin/mutual_aid/add/:id",
        name: "互助物品",
        component: () => import("@/admin/mutualAid/mutualAidAdd.vue"),
      },
      {
        path: "/admin/lost_and_found/list",
        name: "失物招领列表",
        component: () => import("@/admin/lostAndFound/lostAndFound.vue"),
      },
      {
        path: "/admin/lost_and_found/add/:id",
        name: "失物招领",
        component: () => import("@/admin/lostAndFound/lostAndFoundAdd.vue"),
      },
      {
        path: "/admin/claim_goods/add/:id",
        name: "失物招领",
        component: () => import("@/admin/lostAndFound/claimGoods.vue"),
      },
      {
        path: "/admin/task_publishing/list",
        name: "帮啦任务发布列表",
        component: () => import("@/admin/taskPublishing/taskPublishing.vue"),
      },
      {
        path: "/admin/task_publishing/add/:id",
        name: "帮啦任务发布",
        component: () => import("@/admin/taskPublishing/taskPublishingAdd.vue"),
      },
      {
        path: "/admin/message_feedback/list",
        name: "留言反馈列表",
        component: () => import("@/admin/messageFeedback/messageFeedback.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
